package controller.action;

import model.service.GeneralTypeService;
import model.service.SubTypeService;

import com.opensymphony.xwork2.ActionSupport;

public class SubjectType extends ActionSupport{
	private String result;
	private GeneralTypeService generalService;
	private SubTypeService subService;
	private String gid;
	private String pageNum;
	private String Info;
	
	public void setInfo(String info) {
		Info = info;
	}

	public void setPageNum(String pageNum) {
		this.pageNum = pageNum;
	}

	public void setGid(String gid) {
		this.gid = gid;
	}

	public String getResult() {
		return result;
	}
	
	public void setGeneralService(GeneralTypeService generalService) {
		this.generalService = generalService;
	}

	public void setSubService(SubTypeService subService) {
		this.subService = subService;
	}
	public String getAll()
	{
		result = subService.getAll(Integer.parseInt(pageNum));
		return SUCCESS;
	}
	public String getGeneralType()
	{
		result = generalService.getAll();
		return SUCCESS;
	}
	public String getSubType()
	{
		result = subService.getAll(gid);
		return SUCCESS;
	}
	public String add()
	{
		result = subService.add(Info);
		return SUCCESS;
	}
	public String modify(){
		result  = subService.modify(Info);
		return SUCCESS;
	}
	public String delete()
	{
		result = subService.delete(Info);
		return SUCCESS;
	}
	public String query()
	{
		result = subService.query(Info);
		return SUCCESS;
	}
}
